package pl.edu.pw.mini.java2.Communicator.Server;

/*
 * Main serwer worker class:
 * -Accepts connections
 * -Creating worker threads
 * -Add worker do worker's pool to maintain server broadcasting * <later
 */
import java.io.IOException;
import java.net.*;

public class Main {
	public static void main(String[] args) {	
		ServerSocket server = null;
		try {
			server = new ServerSocket(6666);
		} catch (IOException e) {
			ServerLogger.print(e.toString());
			return;
		}

		ServerLogger.print("Server started...");
		while (true) {
			try {
				new ClientHandler(server.accept()).start();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}